


$('.hiSlider1').hiSlider();
$('.hiSlider2').hiSlider({
    isFlexible: true,
    mode: 'fade',
    isSupportTouch: false,
    isShowTitle: false,
    isShowPage: false,
    titleAttr: function(curIdx){
        return $('img', this).attr('alt');
    }
});
$('.hiSlider3').hiSlider({
    isFlexible: true,
    isSupportTouch: true,
    titleAttr: function(curIdx){
        return $('img', this).attr('alt');
    }
});
$('.hiSlider4').hiSlider({
    startSlide: 1,
    direction: 'top'
});
function automatic(){
    var $val = $("#bannertit").text(),
        $valp = $("#bannertitp").text();
    $("#bannertit").text($val.substring(0, 32));
    $("#bannertitp").text($valp.substring(0, 23));
    $('.indexon').addClass("on");
}automatic();
function popBoxHide_fun() {
    $('.pop_box').hide();
}
$('.circleCode').on('click',function () {
    $('.pop_box').show();
    var $thisId = $(this).attr('data-id');
    if($thisId){
        $.ajax({
            type: "POST",
            url: $("#circleCodeajaxurl").val(),
            data: {
                id : $thisId
            },
            dataType:"json",
            success: function(data){
                $("#popCodeCon > img").attr("src",data.pic_url);
                $("#popCodeCon > p").text(data.title);
                // $("#popCodeCon > span").text(data.desc);
            },
            error:function(XMLHttpRequest, textStatus, errorThrown){ //上传失败
                alert("status:"+XMLHttpRequest.status);
                alert("readyState:"+XMLHttpRequest.readyState);
                alert(textStatus);
            }
        });
    }else{
        alert('id错误');
    }
});
//加载更多
function loadmore(){
    var $num = $('#list_box > div.content').length;
    $.ajax({
        type: "POST",
        url: $("#loadmoreajaxurl").val(),
        data: {
            num : $num
        },
        dataType:"json",

        success: function(data){
            var $num = data.length;
            $num < 10 ? $("#loadMore").hide() : '';
            //var urlstr = "{:U('Articletem/post_show',array('id'=>'province_id'))}";
            for(var i=0;i<$num;i++){
                var urlDir= data[i].dir;
                var urlId = data[i].aid;
                var url = "/"+urlDir+"/"+urlId+".html";
                var html = '<div class="content">\n' +
                    '                    <div class="l_iamge">\n' +
                    '                        <a href="javascript:;" class="class" target="_blank">'+data[i].name+'</a>\n' +
                    '                        <a href="'+url+'" target="_blank"><img src="'+data[i].thumbnail+'" ></a>\n' +
                    '                    </div>\n' +
                    '                    <div class="r_content">\n' +
                    '                        <h1><a href="'+url+'" target="_blank">'+data[i].title+'</a></h1>\n' +
                    '                        <span>'+data[i].description+'</span>\n' +
                    '                        <p>\n' +
                    '                            <em class="f_l">'+data[i].time+'</em>\n' +
                    '                            <em class="f_r">\n' +
                    '                                <i class="ico ico_a">&nbsp;</i>'+data[i].browse+'\n' +
                    '                                <i class="ico ico_b ml20">&nbsp;</i>'+data[i].point+'\n' +
                    '                            </em>\n' +
                    '                        </p>\n' +
                    '                    </div>\n' +
                    '                </div>';
                $("#loadMore").before(html);
            }

            //$("#list_box").append('')
//                console.log(data);
//                alert($num)
//                alert(data[0].title)
        },
        error:function(XMLHttpRequest, textStatus, errorThrown){ //上传失败
            alert("status:"+XMLHttpRequest.status);
            alert("readyState:"+XMLHttpRequest.readyState);
            alert(textStatus);
        }
    });
}